/*
 * @Sergii Donchenko, Kiev 2012
 * Prime numbers
 * Program to find prime numbers smaller than inputed number
 */
 import java.util.*;
 public class PrimeNumbers 
 {
	public static void main(String[] arg)
	{
		Scanner in = new Scanner (System.in);
		
		System.out.print ("Write your number:");
		int inputNumber = in.nextInt();
		if (inputNumber <= 0)
		{
			System.out.println ("Incorrect value, please input number more than zero");
		}
		
		int currentNumber, dividers;
        for (currentNumber = 1; currentNumber < inputNumber; currentNumber++)
        {
            dividers = 0;
            for (int count = 1; count <= currentNumber; count++)
            {
                if (currentNumber % count == 0)
                    dividers++;
            }
            if (dividers <= 2)
                System.out.println(currentNumber);
        }
				
		in.close();
	}
}